{% extends "fronted/base.html" %}

{% block main %}
    <div class="box box-primary" style="width: 70%;float: left;">
        <div class="box-header with-border"><h3 class="box-title">讨论列表</h3></div>
        {% if private.discuss_list %}
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tbody>
                        <tr>
                            <td>#</td>
                            <td>标题</td>
                            <td>发布者</td>
                            <td>时间</td>
                        </tr>
                        {% for discuss in private.discuss_list %}
                            <tr>
                                <td>{{ discuss.id }}</td>
                                <td><a href="{{ url_for("fronted.discuss_show", discuss_id = discuss.id) }}">{{ discuss.title }}</a></td>
                                <td>{{ discuss.user }}</td>
                                <td>{{ discuss.time }}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
            <div class="box-footer clearfix">
                  <ul class="pagination pagination-sm no-margin">
                    {% if private.button[0] %}
                        <li><a href="{{ private.button[0] }}">←上页</a></li>
                    {% endif %}
                    {% if private.button[1] %}
                        <li><a href="{{ private.button[1] }}">下页→</a></li>
                    {% endif %}
                  </ul>
            </div>
        {% else %}
            <div class="box-body table-responsive">
                <h3>暂无讨论</h3>
            </div>
        {% endif %}
    </div>
    <div class="box box-primary" style="width: 29%;float: right;">
        <div class="box-header with-border"><a href="{{ url_for("fronted.discuss_new", board_name = private.board_name) }}"><h3 class="box-title">发布讨论</h3></a></div>
    </div>
{% endblock%}